home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in.2</name>
- <id>-1</id>
- <cardCount>23</cardCount>
- <cardID>39297</cardID>
- <listID>10491</listID>
- <cantModify><false /></cantModify>
- <cantDelete><false /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>
- on OpenStack
- set numberFormat to "0.#"
- global holdlevel
- get userlevel
- put It into holdlevel
- set userlevel to 3
- get the freesize of this stack
- if it <> 0 then domenu "Compact Stack"
- get the size of this stack
- put it into Big1
- divide Big1 by 1024
- put Big1 into field 2 of card id 39297
- get field 6 of card id 39297
- if it is empty then ask "Please type in your full name:"
- put it into field 6 of card id 39297
- get field 6 of card id 39297
- if it is empty then domenu "Quit Hypercard"
- create menu "Utilities"
- put "Import,Export,Merge,-,Scan" into menu "Utilities" with menuMsg "Import,Export,,,Look"
- put "First,Prev,Next,Last,-,Find...,Message" into menu "Go"
- put "1,2,3,4,,F,M" into fileMenCmd1
- repeat with x = 1 to number of items of fileMenCmd1
- set commandChar of MenuItem x of menu "Go" to item x of fileMenCmd1
- end repeat
- put "Cut,Copy,Paste Text,-,New Card" into menu "Edit"
- put "X,C,V,,N" into fileMenCmd2
- repeat with x = 1 to number of items of fileMenCmd2
- set commandChar of MenuItem x of menu "Edit" to item x of fileMenCmd2
- end repeat
- put "Open Stack...,Save a Copy...,-,Compact Stack,Protect Stack...,-,Page Setup...,Print Card,Print Report...,Quit" into menu "File"
- put "O,,,,,,,P,,Q" into fileMenCmd3
- repeat with x = 1 to number of items of fileMenCmd3
- set commandChar of MenuItem x of menu "File" to item x of fileMenCmd3
- end repeat
- set menuMsg of MenuItem 10 of menu "File" to "Quit"
- create menu "Sort by"
- put "Name,Formula,Where it is,Date acquired,CAS #,Hazard" into menu "Sort by" with menuMsg "Shuffle,DS1,DS2,DS3,DS4,DS5"
- delete menu "Font"
- delete menu "Style"
- delete menu "Tools"
- put "About Chem Inventory..." into menuItem 1 of menu 1 with menuMsg Dan
-
- end OpenStack
-
- on Dan
- show card field "About" of card id 39297
- show card button id 9 of card id 39297
- show card button id 10 of card id 39297
- end Dan
-
- on Look
- show all cards
- end Look
-
- on Import
- ask "File to import text from?"
- if it is empty then exit Import
- put it into readFrom
- open file readFrom
- repeat forever
- doMenu "Last"
- doMenu "New Card"
- repeat with fieldCount=1 to the number of fields
- read from file readFrom until tab
- if it is empty then --end of file reached
- if fieldCount=1 then doMenu "Delete Card"
- close file readFrom
- exit Import
- end if
- put it into field fieldCount
- end repeat
- end repeat
- end Import
-
- on Export
- ask "Name of file to write to?"
- if it is empty then exit Export
- put it into writeTo
- open file writeTo
- go to second card
- repeat for number of cards
- repeat with fieldCount=1 to the number of fields
- write field fieldCount to file writeTo
- write tab to file writeTo
- end repeat
- go to next card
- end repeat
- close file writeTo
- end Export
-
- on Shuffle
- --This code is copyright 1991 by Dr. Dan Swartling
- --Unauthorized use will be procecuted to the fullest extent
- --of the law.
- answer "Sort all cards of this stack according to:" ¬
- with "Cmpnd Name" or "Cancel"
- if it is "Cmpnd Name" then
- set lockscreen to true
- set lockrecent to true
- repeat for number of cards
- advanceCursor
- repeat with Pt=1 to the length of background field "Compound Name"
- advanceCursor
- put character Pt of background field "Compound Name" into tempChar
- put the charToNum of tempChar into Code
- if Code is 44 then
- subtract 8 from Code
- put the numToChar of Code into tempChar
- put tempChar into character Pt of background field "Compound Name"
- end if
- if (Code >=65) and (Code<=90) then
- put "," before character pt of background field "Compound Name"
- exit repeat
- end if
- advanceCursor
- end repeat
- go to next card
- end repeat
-
- sort by second item of field "Compound Name"
-
- repeat for number of cards
- repeat with Pt=1 to the length of background field "Compound Name"
- advanceCursor
- put character Pt of background field "Compound Name" into tempChar
- put the charToNum of tempChar into Code
- if Code = 44 then
- delete character pt of background field "Compound Name"
- advanceCursor
- exit repeat
- end if
- if Code is 36 then
- add 8 to Code
- put the numToChar of Code into tempChar
- put tempChar into character Pt of background¬
- field "Compound Name"
- end if
- end repeat
- go to next card
- end repeat
- advanceCursor
- set lockscreen to false
- set lockrecent to false
-
- else if it is "Cancel" then
- exit Shuffle
- end if
- end Shuffle
-
- on DS1
- sort by background field "Formula"
- end DS1
-
- on DS2
- sort by background field "Where is it"
- end DS2
-
- on DS3
- sort by background field "DateAcquired"
- end DS3
-
- on DS4
- sort by background field "CAS#"
- end DS4
-
- on DS5
- sort by background field "Hazard"
- end DS5
-
- on AnimCurs CursType, MaxCount
- global AnimCursNumber
- add 1 to AnimCursNumber
- set the cursor to CursType & AnimCursNumber
- if AnimCursNumber > MaxCount then put 1 into AnimCursNumber
- end AnimCurs
- on advanceCursor
- global cursCount
- wait 1 tick
- set cursor to "Earth" & cursCount
- if cursCount > 6
- then put 1 into cursCount
- else add 1 to cursCount
- end advanceCursor
-
- on Quit
- flash three, times
- domenu "Quit HyperCard"
- end Quit
-
- on CloseStack
- global holdlevel
- set userlevel to 5
- reset menubar
- end CloseStack
- </script>
- <background id="4909" file="background_4909.xml" name="" />
- <background id="38941" file="background_38941.xml" name="" />
- <card id="39297" file="card_39297.xml" marked="false" name="Summary" owner="38941" />
- <card id="9073" file="card_9073.xml" marked="false" name="" owner="4909" />
- <card id="9305" file="card_9305.xml" marked="false" name="" owner="4909" />
- <card id="4732" file="card_4732.xml" marked="false" name="" owner="4909" />
- <card id="2585" file="card_2585.xml" marked="false" name="" owner="4909" />
- <card id="2336" file="card_2336.xml" marked="false" name="" owner="4909" />
- <card id="2849" file="card_2849.xml" marked="false" name="" owner="4909" />
- <card id="9500" file="card_9500.xml" marked="false" name="" owner="4909" />
- <card id="6055" file="card_6055.xml" marked="false" name="" owner="4909" />
- <card id="3091" file="card_3091.xml" marked="false" name="" owner="4909" />
- <card id="5859" file="card_5859.xml" marked="false" name="" owner="4909" />
- <card id="3955" file="card_3955.xml" marked="false" name="" owner="4909" />
- <card id="3654" file="card_3654.xml" marked="false" name="" owner="4909" />
- <card id="7830" file="card_7830.xml" marked="false" name="" owner="4909" />
- <card id="5553" file="card_5553.xml" marked="false" name="" owner="4909" />
- <card id="4112" file="card_4112.xml" marked="false" name="" owner="4909" />
- <card id="10606" file="card_10606.xml" marked="false" name="Base card" owner="4909" />
- <card id="9916" file="card_9916.xml" marked="false" name="" owner="4909" />
- <card id="4509" file="card_4509.xml" marked="false" name="" owner="4909" />
- <card id="7953" file="card_7953.xml" marked="false" name="" owner="4909" />
- <card id="7124" file="card_7124.xml" marked="false" name="" owner="4909" />
- <card id="8477" file="card_8477.xml" marked="false" name="" owner="4909" />
- <card id="8779" file="card_8779.xml" marked="false" name="" owner="4909" />
- </stack>
-